package cn.base.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import cn.base.dao.ContDAO;
import cn.base.model.Cont;

@Service
public class ContService {
    @Autowired
    private ContDAO contDAO;

    @Transactional(propagation = Propagation.REQUIRED)
    public void save(Cont course){
        contDAO.save(course);
    }


    @Transactional(propagation = Propagation.SUPPORTS)
    public List<Cont> findAll(){
        return (List<Cont>) contDAO.findAll();
    }
}
